package com.hk.userservice.mapper;


import com.hk.model.WxUserRoleRelation;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;

import java.util.List;

/**
 * @Author: aerfazhe
 * @Date: 2021/7/26 10:40
 * @Statement: 用户角色Mapper层接口
 */

public interface WxUserRoleRelationMapper extends BaseMapper<WxUserRoleRelation> {


    @Override
    List<WxUserRoleRelation> findAll(WxUserRoleRelation wxUserRoleRelation);

    @Override
    int count(WxUserRoleRelation wxUserRoleRelation);

    @Override
    WxUserRoleRelation findById(Integer id);

    @Insert("insert into wx_user_role_relation values (null,#{adminId},#{roleId})")
    @Override
    int save(WxUserRoleRelation wxUserRoleRelation);

    @Override
    int update(WxUserRoleRelation wxUserRoleRelation);

    @Override
    int delete(Integer id);

    List<WxUserRoleRelation> findByAdminId(Integer id);

    @Delete("delete from wx_user_role_relation where admin_id = #{adminId} ")
    int deleteByAdminId(Integer adminId);

}
